<template>
	<view class="page">
		<web-view :src="url" class="h-full w-full"></web-view>
	</view>
</template>

<script setup name="Webview">
	import { onLoad } from '@dcloudio/uni-app'
	import { onMounted, ref } from 'vue'
	
	const url = ref('')
	const title = ref('')
	
	onLoad((option) => {
		// console.log('webview 参数', option)
		url.value = decodeURIComponent(option.url)
		title.value = option.title && decodeURIComponent(option.title)
		if (title.value) {
			uni.setNavigationBarTitle({
				title: title.value
			})
		}
	})
</script>

<style lang="scss" scoped>
	.page {
		height: 100vh;
		padding: 0 30rpx;
		box-sizing: border-box;
	}
</style>
